package com.j.lemon.learn.designpattern.singleton;

import com.j.lemon.learn.designpattern.singleton.ehan.SingletonEHan;
import com.j.lemon.learn.designpattern.singleton.enums.SingletonEnum;
import com.j.lemon.learn.designpattern.singleton.inclass.SingletonIn;
import com.j.lemon.learn.designpattern.singleton.lanhan.SingletonLanHan;

public class SingletonActivity {

    public static void main(String[] args) {
        // 饿汉式[可用]
        SingletonEHan instance = SingletonEHan.getInstance();
        // 懒汉式[双重校验锁 推荐用]
        SingletonLanHan singletonLanHanFour = SingletonLanHan.getSingletonLanHanFour();
        //内部类[推荐用]
        SingletonIn singletonIn = SingletonIn.getSingletonIn();
        // 枚举[推荐用]
        SingletonEnum.instance.whateverMethod();
    }
}
